From: Keir Fraser Date: Thu, 7 Feb 2008 09:19:12 +0000 (+0000) Subject: ioemu: config cleanup re AF_UNIX sockets on non-Windows X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14333^2~8 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=7189dd2eeb4028b3810740afaca85473f4b51aa9;p=xen.git ioemu: config cleanup re AF_UNIX sockets on non-Windows Here is what I wrote in my submission to qemu upstream: The patch below makes it possible to disable AF_UNIX (unix-domain) sockets in host environments which do not define _WIN32, by adding -DNO_UNIX_SOCKETS to the compiler flags. This is useful in the effectively-embedded qemu host which are going to be using for device emulation in Xen. Signed-off-by: Ian Jackson --- diff --git a/tools/ioemu/qemu_socket.h b/tools/ioemu/qemu_socket.h index 6e8bcce6cf..d462d08d60 100644 --- a/tools/ioemu/qemu_socket.h +++ b/tools/ioemu/qemu_socket.h @@ -14,12 +14,19 @@ #define EINTR WSAEINTR #define EINPROGRESS WSAEINPROGRESS +#ifndef NO_UNIX_SOCKETS +#define NO_UNIX_SOCKETS 1 +#endif + #else #include #include #include + +#ifndef NO_UNIX_SOCKETS #include +#endif #define socket_error() errno #define closesocket(s) close(s) diff --git a/tools/ioemu/vl.c b/tools/ioemu/vl.c index 939149c46f..cb94bada09 100644 --- a/tools/ioemu/vl.c +++ b/tools/ioemu/vl.c @@ -3127,7 +3127,7 @@ int parse_host_port(struct sockaddr_in *saddr, const char *str) return 0; } -#ifndef _WIN32 +#ifndef NO_UNIX_SOCKETS static int parse_unix_path(struct sockaddr_un *uaddr, const char *str) { const char *p; diff --git a/tools/ioemu/vnc.c b/tools/ioemu/vnc.c index 11cd94479f..0dd78dd4b4 100644 --- a/tools/ioemu/vnc.c +++ b/tools/ioemu/vnc.c @@ -2401,7 +2401,7 @@ int vnc_display_open(DisplayState *ds, const char *display, int find_unused) } #endif } -#ifndef _WIN32 +#ifndef NO_UNIX_SOCKETS if (strstart(display, "unix:", &p)) { addr = (struct sockaddr *)&uaddr; addrlen = sizeof(uaddr);